package com.springboot.show_web.component;

import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import org.springframework.stereotype.Component;

/**
 * Created by yaosheng on 2019/11/9.
 * 异常处理器携带的数据
 */
//在容器中加入自己定义的ErrorAttributes
@Component
public class MyErrorAttributes extends DefaultErrorAttributes {
    //返回的map就是页面和Json能获取的所有字段
//    @Override
//    public Map<String,Object> getErrorAttributes(RequestAttribute requestAttributes,boolean includeStackTrace){
//        Map<String,Object> map = super.getErrorAttributes (requestAttributes,includeStackTrace);
//        map.put ("Company","S&F");
//        Map<String,Object> ext = (Map<String,Object>)requestAttributes.getAttribute("ext",0);
//        map.put ("ext",ext);
//       return map;

}